/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.androidpublisher.model;

/**
 * Regional pricing and availability configuration for a one-time product offer.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Play Android Developer API. For a detailed
 * explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class OneTimeProductOfferRegionalPricingAndAvailabilityConfig extends com.google.api.client.json.GenericJson {

  /**
   * The absolute value of the discount that is subtracted from the purchase option price. It should
   * be between 0 and the purchase option price.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Money absoluteDiscount;

  /**
   * Required. The availability for this region.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String availability;

  /**
   * The price defined in the purchase option for this region will be used.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private OneTimeProductOfferNoPriceOverrideOptions noOverride;

  /**
   * Required. Region code this configuration applies to, as defined by ISO 3166-2, e.g., "US".
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String regionCode;

  /**
   * The fraction of the purchase option price that the user pays for this offer. For example, if
   * the purchase option price for this region is $12, then a 50% discount would correspond to a
   * price of $6. The discount must be specified as a fraction strictly larger than 0 and strictly
   * smaller than 1. The resulting price will be rounded to the nearest billable unit (e.g. cents
   * for USD). The relative discount is considered invalid if the discounted price ends up being
   * smaller than the minimum price allowed in this region.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Double relativeDiscount;

  /**
   * The absolute value of the discount that is subtracted from the purchase option price. It should
   * be between 0 and the purchase option price.
   * @return value or {@code null} for none
   */
  public Money getAbsoluteDiscount() {
    return absoluteDiscount;
  }

  /**
   * The absolute value of the discount that is subtracted from the purchase option price. It should
   * be between 0 and the purchase option price.
   * @param absoluteDiscount absoluteDiscount or {@code null} for none
   */
  public OneTimeProductOfferRegionalPricingAndAvailabilityConfig setAbsoluteDiscount(Money absoluteDiscount) {
    this.absoluteDiscount = absoluteDiscount;
    return this;
  }

  /**
   * Required. The availability for this region.
   * @return value or {@code null} for none
   */
  public java.lang.String getAvailability() {
    return availability;
  }

  /**
   * Required. The availability for this region.
   * @param availability availability or {@code null} for none
   */
  public OneTimeProductOfferRegionalPricingAndAvailabilityConfig setAvailability(java.lang.String availability) {
    this.availability = availability;
    return this;
  }

  /**
   * The price defined in the purchase option for this region will be used.
   * @return value or {@code null} for none
   */
  public OneTimeProductOfferNoPriceOverrideOptions getNoOverride() {
    return noOverride;
  }

  /**
   * The price defined in the purchase option for this region will be used.
   * @param noOverride noOverride or {@code null} for none
   */
  public OneTimeProductOfferRegionalPricingAndAvailabilityConfig setNoOverride(OneTimeProductOfferNoPriceOverrideOptions noOverride) {
    this.noOverride = noOverride;
    return this;
  }

  /**
   * Required. Region code this configuration applies to, as defined by ISO 3166-2, e.g., "US".
   * @return value or {@code null} for none
   */
  public java.lang.String getRegionCode() {
    return regionCode;
  }

  /**
   * Required. Region code this configuration applies to, as defined by ISO 3166-2, e.g., "US".
   * @param regionCode regionCode or {@code null} for none
   */
  public OneTimeProductOfferRegionalPricingAndAvailabilityConfig setRegionCode(java.lang.String regionCode) {
    this.regionCode = regionCode;
    return this;
  }

  /**
   * The fraction of the purchase option price that the user pays for this offer. For example, if
   * the purchase option price for this region is $12, then a 50% discount would correspond to a
   * price of $6. The discount must be specified as a fraction strictly larger than 0 and strictly
   * smaller than 1. The resulting price will be rounded to the nearest billable unit (e.g. cents
   * for USD). The relative discount is considered invalid if the discounted price ends up being
   * smaller than the minimum price allowed in this region.
   * @return value or {@code null} for none
   */
  public java.lang.Double getRelativeDiscount() {
    return relativeDiscount;
  }

  /**
   * The fraction of the purchase option price that the user pays for this offer. For example, if
   * the purchase option price for this region is $12, then a 50% discount would correspond to a
   * price of $6. The discount must be specified as a fraction strictly larger than 0 and strictly
   * smaller than 1. The resulting price will be rounded to the nearest billable unit (e.g. cents
   * for USD). The relative discount is considered invalid if the discounted price ends up being
   * smaller than the minimum price allowed in this region.
   * @param relativeDiscount relativeDiscount or {@code null} for none
   */
  public OneTimeProductOfferRegionalPricingAndAvailabilityConfig setRelativeDiscount(java.lang.Double relativeDiscount) {
    this.relativeDiscount = relativeDiscount;
    return this;
  }

  @Override
  public OneTimeProductOfferRegionalPricingAndAvailabilityConfig set(String fieldName, Object value) {
    return (OneTimeProductOfferRegionalPricingAndAvailabilityConfig) super.set(fieldName, value);
  }

  @Override
  public OneTimeProductOfferRegionalPricingAndAvailabilityConfig clone() {
    return (OneTimeProductOfferRegionalPricingAndAvailabilityConfig) super.clone();
  }

}
